$('#jia').click(function()
{
    window.location.href='/home/Add'
})
$('#sha').click(function()
{
    window.location.href='/home/index'
})

$('#bao').click(function()
{
    let Id=$('[name=id]').val();
    let productName=$('[name=newname]').val();
    let supplier=$('[name=newnames]').val();
    let price=$('[name=newjiage]').val();
    let stock=$('[name=newku]').val();
    let Remarks=$('[name=newbei]').val();

    let obj=
    {
        Id,productName,supplier,price,stock,Remarks
    }
    console.log(obj);
    $.post('/home/save',obj,function()
    {
        alert('保存成功')
        window.location.href='/home/index'

    })

})
$('#qu').click(function()
{
    window.location.href='/home/index'
})

function bian(id)
{
    window.location.href=`/home/Add/${id}`
}

function sha(id)
{
    let a ="呵呵"

    if(confirm(a))
    {
        window.location.href=`/home/Delete/${id}`

    }else
    {
        alert("取消了")
    }
    

}


